import Vue from 'vue'
import VueRouter from 'vue-router'
const index = () => import('@/views/index')
const grid = () => import('@/views/grid')
const NotFound = () => import('@/views/404')
const Jsx = () => import('@/views/jsx')

Vue.use(VueRouter)

const routes = [
	{
		path: '/',
		component: index,
		meta: {
			layout: 'default-layout'
		},
		children: [
			{
				path: '',
				component: () => import('@/views/home')
			},
			{
				path: 'grid',
				component: grid
			},
			{
				path: 'test',
				component: () => import('@/views/test')
			},
			{
				path: 'jsx',
				component: Jsx
			}
		]
	},
	{
		path: '*',
		component: NotFound
	}
]

const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
